@extends('layout.admin')

@section('title')
<title>分类添加</title>
<link href="{{url('/admins/js/plugins/chosen/chosen/chosen.css')}}" rel="stylesheet">

@endsection


@section('content')

<div id="main" class="color_3">
   
    <div id="main_container">
          <div class="box paint color_3">
            <div class="title" style="color_3">
              <h4> <i class="icon-book"></i><span>分类添加</span> </h4>
            </div>
            <hr>

            {{-- 出错提醒 start --}}
            @if (count($errors) > 0)
            <div style="text-align:center;width:100%;margin-top:10px">
                警告:
                  <ul class="unstyled">
                    @foreach ($errors->all() as $error)
                      <li>{{$error}}</li>
                      @endforeach
                  </ul>
              </div>
           @endif
           {{-- 出错提醒 end --}}

            <div class="content" style="width:800px;margin-left:300px">
              <form class="form-horizontal row-fluid" action="/cate" method="post" enctype="multipart/form-data">
                <div class="form-row control-group row-fluid" style="padding-right:50px;">
                  <label class="control-label span3" for="normal-field">分类名</label>
                  <div class="controls span9" style="padding-right:50px;">
                    <input id="normal-field" class="row-fluid" name="name" value="{{old('name')}}" type="text">
                  </div>
                </div>
                <div class="form-row control-group row-fluid" style="padding-right:50px;">
                    <label class="control-label span3" for="normal-field">父级分类</label>
                    <div class="controls span9" style="padding-right:50px;">
                        <select name="pid" id="" class="row-fluid">
                           <option value="0" >请选择</option>
                           @foreach($cates as $k=>$v)
                           <option value="{{$v['id']}}" >{{$v['name']}}</option>
                           @endforeach
                        </select>
                    </div>
                </div>
                <div class="form-actions row-fluid">
                <div class="span3 visible-desktop"></div>
                  <div class="span7 ">
					<button type="submit" class="btn btn-primary">添加</button>
                    <button type="reset" class="btn btn-secondary">取消</button>
                  </div>
                </div>
                {{csrf_field()}}
              </form>
            </div>
          </div>
          <!-- End .box -->
    </div>
    <!-- End #container --> 
  </div>


@endsection



